import axios from 'axios'

const http = axios.create({
    timeout:5000,
    baseURL:'https://lianghj.top:8888/api/private/v1/'
})

http.interceptors.request.use(config => {
    let token = JSON.parse(localStorage.getItem('token'));
    if(token){
        config.headers.Authorization = token;
    }
    return config;
},err => {
    console.error(err);
})

http.interceptors.response.use(res => {
    return res;
},err => {
    console.error(err);
})

export default http 